import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:jd_flutter/widget/buy_button.dart';
import 'package:jd_flutter/widget/jd_text.dart';

class LoginPage extends StatefulWidget {
  const LoginPage({super.key});

  @override
  State<LoginPage> createState() => _LoginPageState();
}

class _LoginPageState extends State<LoginPage> {





  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context, designSize: const Size(750, 1334));

    return Scaffold(
      appBar: AppBar(
        leading: IconButton(
          icon: const Icon(Icons.close),
          onPressed: () {
            Get.back();
          },
        ),
        actions: [
          TextButton(
            onPressed: (){},
            child: const Text("客服",style: TextStyle(color: Colors.white))
          )
        ],
      ),
      body: Container(
        padding: const EdgeInsets.all(10),
        child:  ListView(
          children: [
            Center(
              child: Container(
                  margin: const EdgeInsets.only(top: 30),
                  height: 160.w,
                  width: 160.h,
                  child: Image.asset("images/login.png",fit:BoxFit.cover)
              ),
            ),
            SizedBox(height: 30.h),
            JDText(
                text: "请输入用户名",
                cb: (val){
                  print(val);
                }
            ),
            SizedBox(height: 20.h),
            JDText(
                text: "请输入密码",
                password: true,
                cb: (val){
                  print(val);
                }
            ),
            Container(
              padding: const EdgeInsets.fromLTRB(5, 5, 5, 0),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  InkWell(onTap: (){},child: const Text("忘记密码")),
                  InkWell(onTap: (){},child: const Text("新用户注册")),
                ],
              )
            ),
            SizedBox(height: 20.h),
            BuyButton(
              color: Colors.red,
              text: "登录",
              cb:(){
                print("登录");
              }
            ),
          ],
        )
      )
    );
  }

  @override
  void dispose() {
    super.dispose();
  }
}
